
//
//  MessageHeaderView.m
//  CommunitySupermarketProiect
//
//  Created by 吕惠卿 on 2017/11/17.
//  Copyright © 2017年 吕惠卿. All rights reserved.
//

#import "MessageHeaderView.h"

@implementation MessageHeaderView
-(id)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self creatUI];
    }
    return self;
}
-(void)creatUI{
    self.centerBtn = [[UIButton alloc]init];
    [self.centerBtn setFont:[UIFont systemFontOfSize:17.0]];
    //    self.centerBtn.backgroundColor = [UIColor yellowColor];
    [self addSubview:self.centerBtn];
    [self.centerBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self);
        make.width.mas_equalTo(WIDTH/3);
        make.height.mas_equalTo(45);
        make.top.equalTo(self.mas_top).with.offset(0);
    }];
    
    UIImageView *line1 = [[UIImageView alloc]init];
    line1.backgroundColor = [UIColor lightGrayColor];
    [self addSubview:line1];
    [line1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self);
        make.width.mas_equalTo(1.5);
        make.height.mas_equalTo(15);
        make.right.equalTo(self.centerBtn.mas_left).with.offset(0);
    }];
    
    self.leftBtn = [[UIButton alloc]init];
    [self.leftBtn setFont:[UIFont systemFontOfSize:17.0]];
    //    self.centerBtn.backgroundColor = [UIColor yellowColor];
    [self addSubview:self.leftBtn];
    [self.leftBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        //        make.width.mas_equalTo(WIDTH/3);
        make.height.mas_equalTo(45);
        make.top.equalTo(self.mas_top).with.offset(0);
        make.left.equalTo(self.mas_left).with.offset(0);
        make.right.equalTo(line1.mas_left).with.offset(0);
    }];
    
    
    
    
    UIImageView *line2 = [[UIImageView alloc]init];
    line2.backgroundColor = [UIColor lightGrayColor];
    [self addSubview:line2];
    [line2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self);
        make.width.mas_equalTo(1.5);
        make.height.mas_equalTo(15);
        make.left.equalTo(self.centerBtn.mas_right).with.offset(0);
    }];
    
    
    self.rightBtn = [[UIButton alloc]init];
    [self.rightBtn setFont:[UIFont systemFontOfSize:17.0]];
    //    self.centerBtn.backgroundColor = [UIColor yellowColor];
    [self addSubview:self.rightBtn];
    [self.rightBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(45);
        make.top.equalTo(self.mas_top).with.offset(0);
        make.right.equalTo(self.mas_right).with.offset(0);
        make.left.equalTo(line2.mas_right).with.offset(0);
    }];
    
}
@end

